﻿using ImportMoudel;
using LightingServer;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Test
{
    public class DataBaseTest
    {
        public void Test2()
        {
            string server = "localhost";
            string database = "zcdb";
            string uid = "root";
            string password = "";
            string connectionString;
            connectionString = "SERVER=" + server + ";" + "DATABASE=" +
            database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
            LightingServerContext.ConnectionStrings = connectionString;
            LightingServerContext.ImageRoot = @"F:\Images";
            LightingServerContext.ImageUrl = "http://127.0.0.1/pic/";


            byte[] bytes = null;
            using (Stream stream = File.OpenRead("G:\\greenwich-140103.zip"))
            {
                bytes = SerializeHelper.ReadFully(stream);
                stream.Close();
            }

            //https://github.com/libingxin/zc.git

            ImportHandler handler = new ImportHandler();
            handler.Import(bytes);
        }
    }
}
